﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Home.WebUI.Areas.Example.Models.Validation;

namespace Home.WebUI.Areas.Example.Controllers
{
    public class FluentValidationController : Controller
    {
        //
        // GET: /Example/FluentValidation/

        public ActionResult Index()
        {
            UserInfo model = new UserInfo();
            model.CreateDate = DateTime.Now;
            return View(model);
        }
        [HttpPost]
        public ActionResult Index(UserInfo model)
        {
            if (ModelState.IsValid)
            {
                model.CreateDate = DateTime.Now;
                return View(model);
            }
            return View(model);
        }

    }
}
